package hr.fer.zemris.gep;

public class NodeEvaluation {
	INode node;
	NodeEvaluation nodeEvals[];
	
	public Object evaluate() {
		if (nodeEvals != null) {
			Object evals[] = new Object[nodeEvals.length];
		
			for (int i=0; i<nodeEvals.length; i++) {
				evals[i] = nodeEvals[i].evaluate();
			}
			return node.evaluate(evals);
		} else {
			return node.evaluate(null);
		}
	}

	public String print() {
		return node.print(nodeEvals);
	}
	
}
